{extend name="pub/base2" /}
{block name="title"}
<title>图片管理</title>
{/block}

{block name="body"}
<section class="Hui-admin-article">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        章节管理
        <span class="c-gray en">&gt;</span>
        图片列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">

        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <form action="{:url('upload')}" enctype="multipart/form-data" method="post">
                        <input type="hidden" value="{$chapter_id}" name="chapter_id">
                        <input type="hidden" value="{$book_id}" name="book_id">
                        <div class="formControls col-xs-3 col-sm-3">
                            <input type="file" multiple="multiple" name="image[]" class="input-text">
                        </div>
                        <div class="formControls col-xs-6 col-sm-6">
                            <input class="btn btn-primary radius" type="submit" value="上传"/>&nbsp;<span
                                style="color: red">图片大小不要超过2M，格式只能是jpg</span>
                        </div>
                    </form>
                    <a class="btn btn-primary radius" href="{:url('clear',['chapter_id' => $chapter_id])}"
                       onClick="return confirm('确定清空?');">清空图片</a>
                    <span class="f-r">共有数据：<strong>{$count}</strong> 条</span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-sort">
                        <thead>
                        <tr class="text-c">
                            <th width="100">ID</th>
                            <th width="150">图片</th>
                            <th width="120">图片序</th>
                            <th width="120">创建时间</th>
                            <th width="120">更新时间</th>
                            <th width="150">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="photos" id="vo"}
                        <tr class="text-c">
                            <td>{$vo.id}</td>
                            <td>
                                <img width="45px;" height="auto" class="picture-thumb" src="{$vo.img_url}">
                            </td>
                            <td>{$vo.pic_order}</td>
                            <td>{$vo.create_time|date='Y-m-d'}</td>
                            <td>{$vo.update_time|date='Y-m-d'}</td>
                            <td class="f-14 td-manage">
                                <a style="text-decoration:none" class="ml-5" onClick="editCreate('图片编辑','/admin/photos/edit?id={$vo.id}&book_id={$book_id}&chapter_id={$chapter_id}')">
                                    <i class="Hui-iconfont">&#xe6df;</i>
                                </a>
                                <a style="text-decoration:none" class="ml-5" onclick="del(this,{$vo.id})" href="javascript:;" title="删除">
                                    <i class="Hui-iconfont">&#xe6e2;</i>
                                </a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    {$photos|raw}
                </div>
            </div>
        </div>
    </article>
</section>

{/block}
